package com.sailfish.springbootdemo.dao.db8;

import com.sailfish.springbootdemo.common.DB8TableName;
import com.sailfish.springbootdemo.pojo.db8.IntfFromVplWebPinattr;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface IntfFromVplWebPinattrDao {

    @Insert("<script>" +
            "insert into " + DB8TableName.INTF_FROM_VPLWEB_PINATTR + " " +
            "( "+
            "GUID, " +
            "mpn, " +
            "pin_min_pitch, " +
            "pin_count, " +
            "pin_number, " +
            "pin_x_v, " +
            "pin_y_v, " +
            "pin_length, " +
            "pin_width, " +
            "pin_length_tol_p, " +
            "pin_length_tol_n, " +
            "pin_width_tol_p, " +
            "pin_width_tol_n, " +
            "pin_type, " +
            "pin_high, " +
            "pin_high_tol_p, " +
            "pin_high_tol_n, " +
            "creator " +
            ")"+
            "values "+
            "<foreach collection=\"entities\" item=\"entity\" separator=\",\">" +
            "(" +
            "#{entity.GUID}, " +
            "#{entity.mpn}, " +
            "#{entity.pin_min_pitch}, " +
            "#{entity.pin_count}, " +
            "#{entity.pin_number}, " +
            "#{entity.pin_x_v}, " +
            "#{entity.pin_y_v}, " +
            "#{entity.pin_length}, " +
            "#{entity.pin_width}, " +
            "#{entity.pin_length_tol_p}, " +
            "#{entity.pin_length_tol_n}, " +
            "#{entity.pin_width_tol_p}, " +
            "#{entity.pin_width_tol_n}, " +
            "#{entity.pin_type}, " +
            "#{entity.pin_high}, " +
            "#{entity.pin_high_tol_p}, " +
            "#{entity.pin_high_tol_n}, " +
            "#{entity.creator} " +
            ")"+
            "</foreach>"+
            "</script>"
    )
    Integer insertIntfFromVplWebPinattrBatch(@Param("entities") List<IntfFromVplWebPinattr> entities);

}
